package com.ftg.learn.chapter09.pattern.singleton;

/**
 * 懒汉模式   饱汉模式
 *
 * @author kangjx
 * @date 2023/1/16
 */
public class SecondSingletonPattern {

    private SecondSingletonPattern() {

    }

    /**
     * 产生一个引用 SecondSingletonPattern  instance
     */
    private static SecondSingletonPattern instance;

    public static SecondSingletonPattern getInstance() {
        if (null == instance) {
            instance = new SecondSingletonPattern();
        }
        return instance;
    }

}
